/*记载栏目信息*/
function listinfo(url, id, sz) {
	var lanmuDoc = null;

	if (window.ActiveXObject) {
		/* 信息url */
		lanmuDoc = new ActiveXObject('Microsoft.XMLDOM');
		lanmuDoc.async = false;
		lanmuDoc.load(url);

		if (lanmuDoc.parseError.errorCode != 0) {
			alert(lanmuDoc.parseError.reason);
		}

	}

	if (lanmuDoc == null) {
		alert('您的浏览器不支持xml文件读取,于是本页面禁止您的操作,推荐使用IE5.0以上可以解决此问题!');
	} else {		
		/* 栏目标题 */
		var direc = getNode(lanmuDoc, "/root/title");
		/* 栏目有效性 */
		var valid = getNode(lanmuDoc, "/root/valid");
		/* 栏目访问权限 */
		var noright = getNode(lanmuDoc, "/root/noright");
		/* 数据总计 */
		var totalinfo = getNode(lanmuDoc, "/root/totalinfo");
		/* 页数总计 */
		var totalpage = getNode(lanmuDoc, "/root/totalpage");

		/* 栏目内信息 */
		var items = lanmuDoc.selectNodes("/root/info");

		if (!document.getElementById("title4" + id)) {
			// alert("请在视图页面定义id=\"lanmumoretlt\"的元素用于显示栏目标题");
		}

		if (!document.getElementById("list4" + id)) {
			alert("请在视图页面定义id=\"list4" + id + "\"的元素用于显示栏目信息");
		} else if (valid == "false" && document.getElementById("title4" + id)) {
			document.getElementById("title4" + id).innerHTML = "无效栏目";
		} else if (noright == "true") {
			document.getElementById("list4" + id).innerHTML = "您没有访问该栏目的权限";
		} else {
			if (document.getElementById("title4" + id))
				document.getElementById("title4" + id).innerHTML = direc;
			document.getElementById("list4" + id).innerHTML = "";
			/* 显示栏目信息列表 */
			if (items.length > 0) {
				for (var i = 0; i < items.length; i++) {
					var tlt = getNode(lanmuDoc, "/root/info[" + i + "]/title");
					var url = getNode(lanmuDoc, "/root/info[" + i + "]/url");
					document.getElementById("list4" + id).innerHTML += "<div>"+(i+1)+"..<a href=\""
							+ url
							+ "\" title=\""+tlt+"\" target=\"_blank\">"
							+ ((sz!=null&&tlt.length>sz)?(tlt.substring(0,17) + "..."):tlt);
							+ "</a></div>";
				}
			} else {
				document.getElementById("list4" + id).innerHTML += "<font color=\"blue\">无信息内容</font>";
			}

			if (document.getElementById("total4" + id)) {
				document.getElementById("total4" + id).innerHTML = totalinfo;
			}
		}
	}
	
	return true;
}

/*加载待办信息*/
function listdaiban(url, id) {
	var lanmuDoc = null;

	if (window.ActiveXObject) {
		/* 信息url */
		lanmuDoc = new ActiveXObject('Microsoft.XMLDOM');
		lanmuDoc.async = false;
		lanmuDoc.load(url);

		if (lanmuDoc.parseError.errorCode != 0) {
			alert(lanmuDoc.parseError.reason);
		}

	}

	if (lanmuDoc == null) {
		alert('您的浏览器不支持xml文件读取,于是本页面禁止您的操作,推荐使用IE5.0以上可以解决此问题!');
	} else {
		/* 栏目标题 */
		var direc = getNode(lanmuDoc, "/root/title");
		/* 栏目有效性 */
		var valid = getNode(lanmuDoc, "/root/valid");
		/* 栏目访问权限 */
		var noright = getNode(lanmuDoc, "/root/noright");
		/* 数据总计 */
		var totalinfo = getNode(lanmuDoc, "/root/totalinfo");
		/* 页数总计 */
		var totalpage = getNode(lanmuDoc, "/root/totalpage");

		/* 栏目内信息 */
		var items = lanmuDoc.selectNodes("/root/info");

		if (!document.getElementById("title4" + id)) {
			// alert("请在视图页面定义id=\"lanmumoretlt\"的元素用于显示栏目标题");
		}

		if (!document.getElementById("list4" + id)) {
			alert("请在视图页面定义id=\"list4" + id + "\"的元素用于显示栏目信息");
		} else if (valid == "false" && document.getElementById("title4" + id)) {
			document.getElementById("title4" + id).innerHTML = "无效栏目";
		} else if (noright == "true") {
			document.getElementById("list4" + id).innerHTML = "您没有访问该栏目的权限";
		} else {
			if (document.getElementById("title4" + id))
				document.getElementById("title4" + id).innerHTML = direc;
			document.getElementById("list4" + id).innerHTML = "";
			/* 显示栏目信息列表 */
			if (items.length > 0) {
				for (var i = 0; i < items.length; i++) {
					var tlt = getNode(lanmuDoc, "/root/info[" + i + "]/title");
					var url = getNode(lanmuDoc, "/root/info[" + i + "]/url");
					var desc = getNode(lanmuDoc, "/root/info[" + i + "]/desc");
					var date = getNode(lanmuDoc, "/root/info[" + i + "]/date");
					document.getElementById("list4" + id).innerHTML += "<table width=100% class=tab-noborder><tr><td width=5%>"+(i+1)+"..</td><td><a href=\""
							+ url
							+ "\" title=\""+tlt+"\">"
							+ ((tlt.length > 18)?tlt.substring(0,18) + "...":tlt)
							+ "</a></td>"
							+ "<td width=30%>" + desc + "</td>"
							+ "<td width=13%>" + date + "</td>"
							+ "</tr></table>";
				}
			} else {
				document.getElementById("list4" + id).innerHTML += "<font color=\"blue\">无待办事项</font>";
			}

			if (document.getElementById("total4" + id)) {
				document.getElementById("total4" + id).innerHTML = totalinfo;
			}
		}
	}
	
	return true;
}

/* 获取xml节点内容 */
function getNode(doc, xpath) {
	var retval = "";
	var value = doc.selectSingleNode(xpath);
	if (value) {
		retval = value.text
	};
	return retval;
}